package com.videoaggre.zcl.parse

import com.tencent.smtt.sdk.WebView

typealias CancelCallback = () -> Unit

interface IParse {
    fun injectCancel(cancel: CancelCallback)
    fun url(): String
    fun success(html: String)
    fun start() {}
    fun error() {}
    fun onPageFinished(webView: WebView, url: String) {
        webView.evaluateJavascript("""javascript:Jsbridge.html(document.getElementsByTagName('html')[0].innerHTML)""") {}
    }

    fun shouldInterceptRequest(url: String) {}
    val successDestroy: Boolean get() = true
    fun cancel()
}